# -*- coding:utf-8 -*-

from django.template import Context, Template

"""
    template = Template("Hello {{ name  }}!")
    context = Context({'name': "demo"})
    result = template.render(context)
"""


class contextBase:
    def __init__(self, variable):
        self.variable = variable

    @property
    def get_var(self):
        return Context(self.variable)


class Tem:
    def __init__(self, template, variable):
        self.template = template
        self.variable = variable

    @property
    def result(self, ):
        return Template(self.template).render(contextBase(self.variable).get_var)


